home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: August 30, 1999
- //
- // Description:
- // This script a panel which has both an outliner and a graph editor
- // within it.
- //
- // Input Arguments:
- // None.
- //
- // Return Value:
- // None.
- //
-
- global proc buildClipEditorViewMenu (string $clipEditor, string $parentMenu)
- //
- // Procedure Name:
- // buildClipEditorViewMenu
- //
- // Description:
- // This creates submenu items for view
- // functionality in the dope sheet.
- //
- // Input Arguments:
- // None.
- //
- // Return Value:
- // None.
- //
- {
- }
-
- global proc buildTraxContextHelpItems(string $nameRoot, string $menuParent)
- //
- // Description:
- // Build context sensitive menu items
- //
- // Input Arguments:
- // $nameRoot - name to use as the root of all item names
- // $menuParent - the name of the parent of this menu
- //
- // Return Value:
- // None
- //
- {
- menuItem -label "Help on Trax..."
- -enableCommandRepeat false
- -command "showHelp TraxEditor";
- }
-
- global proc createClipEditorPanel (string $whichPanel)
- //
- // Description:
- // Define the editors that are used in this panel. No
- // controls (widgets) are created at this point.
- //
- {
- // create unique names for editors based on panel name
- //
- string $clipEditor = ($whichPanel + "ClipEditor");
- string $outlineEditor = ($whichPanel + "OutlineEditor");
-
- // WARNING: Changes here must also be made in buildNewSceneUI.mel
- //
- characterOutlineEditor -unParent $outlineEditor;
- clipEditor -unParent -characterOutline $outlineEditor $clipEditor;
-
-
- if (`exists clipEditorRegisterActions`)
- clipEditorRegisterActions $clipEditor;
-
- // Add support for the Context Sensitive Help Menu.
- //
- addContextHelpProc $whichPanel "buildTraxContextHelpItems";
- }
-
- global proc addClipEditorPanel (string $whichPanel)
- //
- // Description:
- // Add the panel to a layout.
- // Parent the editors to that layout and create any other
- // controls (widgets) required.
- //
- {
- string $clipEditor = ($whichPanel + "ClipEditor");
- string $outlineEditor = ($whichPanel + "OutlineEditor");
- string $outlineEditorForm = ($whichPanel + "OutlineEditorForm");
-
- formLayout baseForm;
-
- // Make toolbar
- //
- frameLayout
- -visible true
- -borderVisible false
- -labelVisible false
- -collapsable false
- -collapse true
- -borderStyle "in"
- toolbarFrame;
- string $toolBarForm = `formLayout -visible true toolbarForm`;
- int $iconsize = 26;
-
- setParent toolbarForm;
-
- iconTextButton
- -i1 "traxCreateClip.xpm"
- -w $iconsize -h $iconsize
- -annotation "Create Clip"
- createClipButton;
-
- iconTextButton
- -i1 "traxCreateBlend.xpm"
- -w $iconsize -h $iconsize
- -annotation "Create Blend"
- createBlendButton;
-
- separator -horizontal false -style single ctbSeparator1;
-
- iconTextButton
- -i1 "hsVisorOpen.xpm"
- -w $iconsize -h $iconsize
- -annotation "Visor"
- openVisorButton;
-
- separator -horizontal false -style single ctbSeparator2;
-
- iconTextButton
- -i1 "traxFrameAll.xpm"
- -w $iconsize -h $iconsize
- -annotation "Frame All"
- frameAllButton;
-
- iconTextButton
- -i1 "traxFrameRange.xpm"
- -w $iconsize -h $iconsize
- -annotation "Frame Timeline Range"
- frameRangeButton;
-
- separator -horizontal false -style single ctbSeparator3;
-
- iconTextButton
- -i1 "traxGraphAnimCurves.xpm"
- -w $iconsize -h $iconsize
- -annotation "Graph Anim Curves"
- graphAnimCurvesButton;
-
- /*
- iconTextButton
- -i1 "traxGraphWeightCurves.xpm"
- -w $iconsize -h $iconsize
- -annotation "Graph Weight Curves"
- graphWeightCurvesButton;
- */
-
-
- formLayout -edit
- -attachForm createClipButton "left" 0
- -attachForm createClipButton "top" 0
- -attachForm createClipButton "bottom" 0
-
- -attachControl createBlendButton "left" 0 createClipButton
-
- -attachControl ctbSeparator1 "left" 0 createBlendButton
- -attachForm ctbSeparator1 "top" 1
- -attachForm ctbSeparator1 "bottom" 1
-
- -attachControl openVisorButton "left" 0 ctbSeparator1
-
- -attachControl ctbSeparator2 "left" 0 openVisorButton
- -attachForm ctbSeparator2 "top" 1
- -attachForm ctbSeparator2 "bottom" 1
-
- -attachControl frameAllButton "left" 0 ctbSeparator2
- -attachControl frameRangeButton "left" 0 frameAllButton
-
- -attachControl ctbSeparator3 "left" 0 frameRangeButton
- -attachForm ctbSeparator3 "top" 1
- -attachForm ctbSeparator3 "bottom" 1
-
- -attachControl graphAnimCurvesButton "left" 0 ctbSeparator3
- /* -attachControl graphWeightCurvesButton "left" 0 graphAnimCurvesButton */
-
- toolbarForm;
-
- setParent baseForm;
-
- // Define container widget to hold the clip editor and outline.
- $containerWidget = `rowLayout -numberOfColumns 2
- -adjustableColumn 2 -columnWidth 1 200
- -rowAttach 1 "both" 0 -columnAttach 1 "both" 0
- -rowAttach 2 "both" 0 -columnAttach 2 "both" 0`;
-
- // Create a form to hold the outline and its resize buttons.
- formLayout -parent $containerWidget $outlineEditorForm;
- characterOutlineEditor -edit -parent $outlineEditorForm $outlineEditor;
-
- // Put the clip editor into the container.
- clipEditor -edit -parent $containerWidget $clipEditor;
-
- // Add two resize buttons to the outline form to control the size of
- // the form which holds the outline and the clis editor.
- button -l "<<" -parent $outlineEditorForm
- -h 15 -rs false
- -ann "Decrease outline size"
- -command ( "setCharacterOutlineSize smaller " + $containerWidget )
- characterOutlineSmallerButton;
- button -l ">>" -parent $outlineEditorForm
- -h 15 -rs false
- -ann "Increase outliner size"
- -command ( "setCharacterOutlineSize bigger " + $containerWidget )
- characterOutlineBiggerButton;
-
- // Layout the outline form.
- formLayout -e
- -af characterOutlineSmallerButton left 0
- -ap characterOutlineSmallerButton right 0 50
- -af characterOutlineSmallerButton bottom 0
- -an characterOutlineSmallerButton top
-
- -ap characterOutlineBiggerButton left 0 50
- -af characterOutlineBiggerButton right 0
- -af characterOutlineBiggerButton bottom 0
- -an characterOutlineBiggerButton top
-
- -af $outlineEditor left 0
- -af $outlineEditor right 0
- -af $outlineEditor top 0
- -ac $outlineEditor bottom 0 characterOutlineSmallerButton
- $outlineEditorForm;
-
- // Ensure that the outline layout is the correct size,
- // based on the optionVar characterOutlineEditorWidth.
- global int $gCharacterOutlineEditorWidth;
- if( !`optionVar -exists characterOutlineEditorWidth` ) {
- optionVar -iv characterOutlineEditorWidth 200;
- }
- $gCharacterOutlineEditorWidth = `optionVar -q characterOutlineEditorWidth`;
- rowLayout -e -columnWidth 1 $gCharacterOutlineEditorWidth $containerWidget;
-
- // attach the the container widget to the edges of the base form
- // and the bottom of the toolbar
- //
- formLayout -edit
- -attachForm toolbarFrame top 0
- -attachForm toolbarFrame left 0
- -attachForm toolbarFrame right 0
- -attachForm $containerWidget left 0
- -attachForm $containerWidget right 0
- -attachForm $containerWidget bottom 0
- -attachControl $containerWidget top 0 toolbarFrame
- baseForm;
-
- setParent `scriptedPanel -query -control $whichPanel`;
-
- setParent -top;
- }
-
- global proc setCharacterOutlineSize (string $size, string $rowLayout)
- //
- //
- {
- global int $gCharacterOutlineEditorWidth;
-
- if( $size == "bigger" ) {
- if( $gCharacterOutlineEditorWidth <= 300 ) {
- $gCharacterOutlineEditorWidth = $gCharacterOutlineEditorWidth + 20;
- }
- } else {
- if( $gCharacterOutlineEditorWidth >= 200 ) {
- $gCharacterOutlineEditorWidth = $gCharacterOutlineEditorWidth - 20;
- }
- }
-
- rowLayout -e -columnWidth 1 $gCharacterOutlineEditorWidth $rowLayout;
- optionVar -iv characterOutlineEditorWidth $gCharacterOutlineEditorWidth;
- }
-
- global proc removeClipEditorPanel (string $whichPanel)
- //
- // Description:
- // Remove the panel from a layout.
- // Delete controls.
- //
- {
- string $clipEditor = ($whichPanel + "ClipEditor");
-
- if (`clipEditor -exists $clipEditor`) {
- clipEditor -edit -unParent $clipEditor;
- }
- }
-
- global proc deleteClipEditorPanel (string $whichPanel)
- //
- // Description:
- // This proc will delete the contents of the panel, but not
- // the panel itself.
- //
- // Note:
- // We only need to delete editors here. Other UI will be taken care of
- // by the remove proc.
- //
- {
- string $clipEditor = ($whichPanel + "ClipEditor");
-
- if (`clipEditor -exists $clipEditor`) {
- deleteUI -editor $clipEditor;
- }
- }
-
- global proc string saveStateClipEditorPanel (string $whichPanel)
- //
- // Description:
- // This proc returns a string that when executed will restore the
- // current state of the panel elements.
- //
- {
- string $indent = "\n\t\t\t";
- string $clipEditor = ($whichPanel + "ClipEditor");
-
- return (
- $indent + "$editorName = ($panelName+\"ClipEditor\");\n" +
- `clipEditor -query -stateString $clipEditor`
- );
- }
-
- global proc clipEditorPanel (string $panelName)
- {
- }
-
- global proc string [] clipEditorFilterCategories()
- //
- // Description:
- // Return the types of filters that the Clip Editor will display
- // in its "Show->Objects" filter menu.
- //
- {
- string $result[] = { "Modeling", "Camera", "Animating" };
- return $result;
- }
-